﻿Public Class TutorialControl
    Event NextClicked()

    <System.ComponentModel.Category("Appearance")> _
    <System.ComponentModel.Editor("System.ComponentModel.Design.MultilineStringEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", GetType(System.Drawing.Design.UITypeEditor))> _
    Public Property TutorialText As String
        Get
            Return TextLabel.Text
        End Get
        Set(ByVal value As String)
            TextLabel.Text = value
        End Set
    End Property

    Private Sub NextButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles NextButton.Click
        RaiseEvent NextClicked()
    End Sub

    Public Sub ShowAndMoveOn()
        Me.Show()
        AddHandler NextClicked, AddressOf Me.Hide

        Dim MyNumber As Integer = Name.Replace("TutorialControl", "")
        For Each Control As Control In Parent.Controls
            If Control.Name = "TutorialControl" & MyNumber + 1 Then
                AddHandler NextClicked, AddressOf CType(Control, TutorialControl).ShowAndMoveOn
            End If
        Next
    End Sub
End Class

